package com.free.framework.widgets.custom_loading;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;


/**
 * Created by Administrator on 2016/10/31.
 */

public class LoadingUtils {

    private LoadingUtils(){}

    private static final  String TAG = "LoadingUtils";

    public static void showDialog(FragmentManager fragmentManager){

        LoadingFragment loadingFragment = new LoadingFragment();
        loadingFragment.show(fragmentManager,TAG);

    }

    public static void dismiss(FragmentManager fragmentManager){
        LoadingFragment fragment = ((LoadingFragment)fragmentManager.findFragmentByTag(TAG));
        if(fragment!=null){
            fragment.dismiss();
        }
    }



}
